const _import = file => () => import('@/views/' + file);
const secondRouter = [
    {
        path: 'home',
        name: 'home',
        meta:{
            title: '首页'
        },
        component: _import('home/home'),
        children: [
            {
                path: 'recommend',
                name: 'recommend',
                component: _import('home/recommend')
            },
            {
                path: 'secondCategory/:id',
                name: 'secondCategory',
                component: _import('home/secondCategory')
            }
        ],
        redirect: {name: 'recommend'},
    },
    {
        path: 'discover',
        name: 'discover',
        meta:{
            title: '发现'
        },
        component: _import('discover/discover')
    },
    {
        path: 'person',
        name: 'person',
        meta:{
            title: '我的'
        },
        component: _import('person/person')
    },{
        path: 'secondPage/:name/:cateid/:id',
        name: 'secondPage',
        meta:{
            title: '二级目录详细展开'
        },
        children: [
            {
                path: 'secondDetail/:id',
                name: 'secondDetail',
                component: _import('home/secondDetail')
            },
        ],
        component: _import('home/secondPage')
    }
]
const reservice = [
    {
        path: '/customerService',
        name: 'customerService',
        meta:{
            title: '售后维权'
        },
        component: _import('reservice/customerService')
    },
]
var maps = [
    {	
    	name: 'tabs',
        path: '/tabs',
        redirect: {name: 'home'},
        component: _import('tabs'),
        children: secondRouter
    },
    {
        name: 'login',
        path: '/login',
        meta: {
            title: '登录'
        },
        component: _import('person/login')
    },
    {
        name: 'guide',
        path: '/guide',
        meta: {
            title: '设置密码'
        },
        component: _import('person/guide')
    },
    {
        name: 'fwdPwd',
        path: '/fwdPwd',
        meta: {
            title: '找回密码'
        },
        component: _import('person/findPwd')
    },
    {
        name: 'personHome',
        path: '/personHome',
        meta: {
            title: '个人信息'
        },
        component: _import('person/personHome')
    },
    {
        name: 'sets',
        path: '/sets',
        meta: {
            title: '设置'
        },
        component: _import('person/sets')
    },
    {
        name: 'ordersLs',
        path: '/ordersLs',
        meta: {
            title: '租赁订单'
        },
        component: _import('person/ordersLs')
    },
    {
        name: 'cancel',
        path: '/cancel',
        meta: {
            title: '取消订单'
        },
        component: _import('person/cancel')
    },{
		path: '*',
        redirect: {name: 'tabs'},
    },{
        // 详情页面
        path: '/choose/:id',
        name: 'choose',
        component: _import('home/choose')
    },{
        //聚合页
        path: '/collectPage/:id',
        name: 'collectPage',
        component: _import('home/collectPage')
    },{
        path: '/advice',
        name: 'advice',
        meta: {
            title: "搜索提示"
        },
        component: _import('home/advice')
    },{
        path: '/searchResult/:searchStr',
        name: 'searchResult',
        meta: {
            title: "搜索结果"
        },
        component: _import('home/searchResult')
    },{
        path: '/discoverInfo/:id',
        name: 'discoverInfo',
        meta: {
            title: "活动详情"
        },
        component: _import('discover/discoverInfo')
    },{
        path: '/personInfo',
        name: 'personInfo',
        meta: {
            title: "个人信息收集"
        },
        component: _import('home/personInfo')
    },{
        path: '/orderPage',
        name: 'orderPage',
        meta: {
            title: "确认预约"
        },
        component: _import('home/order')
    },{
        path: '/authorization',
        name: 'authorization',
        meta: {
            title: "授权"
        },
        component: _import('home/authorization')
    },{
        path: '/orderResult',
        name: 'orderResult',
        meta: {
            title: "成功预约"
        },
        component: _import('home/orderResult')
    },{
        path: '/borrowCache',
        name: 'borrowCache',
        meta: {
            title: "成功预约"
        },
        component: _import('home/borrowCache')
    },{
        path: '/messageCenter',
        name: 'messageCenter',
        meta: {
            title: "消息中心"
        },
        component: _import('home/messageCenter')
    },{
        path: '/messageDetail',
        name: 'messageDetail',
        meta: {
            title: "消息列表"
        },
        component: _import('home/messageDetail')
    },{
        path: '/repairList',
        name: 'repairList',
        meta: {
            title: "维修列表"
        },
        component: _import('reservice/repairList')
    },{
        path: '/repairDetail',
        name: 'repairDetail',
        meta: {
            title: "维修详情"
        },
        component: _import('reservice/repairDetail')
    },{
        path: '/afterSale',
        name: 'afterSale',
        meta: {
            title: "服务订单列表"
        },
        component: _import('reservice/afterSale')
    },{
        path: '/confirmService',
        name: 'confirmService',
        meta: {
            title: "服务订单列表"
        },
        component: _import('reservice/confirmService')
    },{
        path: '/progress',
        name: 'progress',
        meta: {
            title: "进度"
        },
        component: _import('reservice/progress')
    }
];

maps = maps.concat(reservice);
export default maps;